#include <QtGui>
#include <QtCore>

int main(int argc, char* argv[])
{
	QApplication app(argc, argv);

	QProcess proc;
	proc.start("./a.out");
	if(!proc.waitForStarted())
		return false;
	proc.closeWriteChannel();
	QByteArray out;
	while(!proc.waitForFinished(0))
	{
		//if(proc.waitForReadyRead(10))
		{
			out=proc.read(10);
			qDebug()<<out;
			printf("read\n");
			sleep(1);
		}
	}
	return 0;
}

